package com.cff.action.imggps;

import java.awt.TextArea;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Iterator;
import java.util.Set;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import com.cff.util.EventUtil;

public class GpsImgActionListener implements ActionListener {
	private static String filePath;
	@Override
	public void actionPerformed(ActionEvent e) {
		// 添加显示窗口
		JFrame tmpFrame = new JFrame();
		tmpFrame.setBounds(200, 50, 800, 660);
		tmpFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		tmpFrame.setLayout(null);
		tmpFrame.setVisible(true);

		JMenuBar bar = new JMenuBar();
		JMenu fileMenu = new JMenu("文件");
		JMenu appMenu = new JMenu("功能");
		JMenuItem fileOpenItem = new JMenuItem("打开");
		JMenuItem gpsImgItem = new JMenuItem("定位");
		fileMenu.add(fileOpenItem);
		appMenu.add(gpsImgItem);
		bar.add(fileMenu);
		bar.add(appMenu);
		tmpFrame.setJMenuBar(bar);
		
		ActionListener gpsImgOpenActionListener = new GpsImgOpenActionListener(tmpFrame);
		EventUtil.putEvent(fileOpenItem, gpsImgOpenActionListener);
		
		ActionListener gpsImgOriActionListener = new GpsImgOriActionListener(tmpFrame);
		EventUtil.putEvent(gpsImgItem, gpsImgOriActionListener);
		
	}
	
	public void setToDefault(JFrame tmpFrame){
		tmpFrame.setBounds(200, 50, 800, 660);
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

}
